[TASK-293] Builder pattern, cleanup, consistent API#296
Merged
luoyuxia merged 1 commit intoapache:mainfrom Feb 11, 2026
Merged
Conversation
Contributor
Author
|
@luoyuxia @leekeiabstraction PTAL 🙏 |
There was a problem hiding this comment.
Pull request overview
This PR aligns the C++ bindings’ Table/Connection APIs with the Java/Rust-style builder pattern, while consolidating Rust FFI entrypoints (scanner/upsert) to reduce surface area and duplication.
Changes:
- Introduce
TableAppend/TableUpsert/TableLookupbuilder-style APIs (NewAppend/NewUpsert/NewLookup) and update examples accordingly. - Rename
Connection::ConnecttoConnection::Createto match other languages’ naming. - Consolidate Rust FFI scanner creation into
create_scanner(...)and upsert writer creation intocreate_upsert_writer(...).
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| bindings/cpp/src/table.cpp | Implements new C++ builder objects for append/upsert/lookup and routes scan creation through consolidated FFI. |
| bindings/cpp/src/lib.rs | Consolidates FFI methods (create_scanner, create_upsert_writer) and refactors Table internals to reuse fluss_table(). |
| bindings/cpp/src/connection.cpp | Renames connection factory from Connect to Create and small include/format cleanup. |
| bindings/cpp/include/fluss.hpp | Exposes new builder classes and updates the public C++ API accordingly. |
| bindings/cpp/examples/kv_example.cpp | Updates example usage to new builder APIs + Connection::Create. |
| bindings/cpp/examples/example.cpp | Updates example usage to new builder APIs + Connection::Create. |
| bindings/cpp/examples/admin_example.cpp | Updates example usage to Connection::Create. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
0d26eca to
ea8ac21
Compare
Contributor
Author
|
Addressed comments |
ea8ac21 to
206f0ad
Compare
206f0ad to
8fbd979
Compare
leekeiabstraction
approved these changes
Feb 10, 2026
Contributor
leekeiabstraction
left a comment
There was a problem hiding this comment.
Approved, TY for the PR!
luoyuxia
approved these changes
Feb 11, 2026
Contributor
luoyuxia
left a comment
There was a problem hiding this comment.
@fresh-borzoni Thanks. +1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
closes #293
Connection::ConnecttoConnection::Createto align with Java'screateConnectionAPI changes
Connection
Connection::Connect(addr, conn) -> Connection::Create(addr, conn)
Append
table.NewAppendWriter(writer) -> table.NewAppend().CreateWriter(writer)
Upsert
table.NewUpsertWriter(writer)-> table.NewUpsert().CreateWriter(writer)
table.NewUpsertWriter(writer, names) -> table.NewUpsert().PartialUpdateByName(names).CreateWriter(writer)
table.NewUpsertWriter(writer, indices) -> table.NewUpsert().PartialUpdateByIndex(indices).CreateWriter(writer)
Lookup
table.NewLookuper(lookuper) -> table.NewLookup().CreateLookuper(lookuper)
Rust FFI consolidation